package Test;

import Dao.CourseDao;
import Dao.Courseimply;
import Dao.studentDao;
import Dao.studentimply;
import Pojo.Course;
import Pojo.Student;
import Service.CourseService;
import Utils.WebUtils;
import dto.StudentCourse;
import org.junit.Test;

import java.util.List;

public class studentTest {
    studentDao studentDao=new studentimply();
    CourseDao courseDao=new Courseimply();
    @Test
    public void test(){
        studentDao.add(new Student(null,"小明","kk","kk","福州",0));
    }
    @Test
    public void test1(){
        studentDao.deleteByid("3");
    }
    @Test
    public void test2(){
        studentDao.update(new Student(2,"猪猪繁","jj","22","福州",0));
    }
    @Test
    public void test3(){

        Student student = studentDao.selectByno(1);
        System.out.println(student);
    }
    @Test
    public void test4(){
        List<Student> students = studentDao.selectForlist();
        students.forEach(System.out::println);
    }
    @Test
    public void test5(){
        studentDao.modPwd("14","xx");
    }
    @Test
    public void test6(){
        Student xx = studentDao.selectBysnameAndpwd("Jony","1");
        System.out.println(xx);
    }
    @Test
    public void test7(){
        CourseService vv= new Service.Courseimply();
        List<Course> courses = vv.queryCourseTable();
        courses.forEach(System.out::println);
    }
    @Test
    public void test8(){
        CourseDao courseDao=new Courseimply();
        Course course = courseDao.selectByno(1);
        System.out.println(course);
    }
    @Test
    public void test9(){
        CourseService courseService=new Service.Courseimply();
        Course course = courseService.selectOne(1);
        System.out.println(course);
    }
//    @Test
//    public void test10(){
//        courseDao.add(new Course(3,"语文","14.00-18.00","教学楼"));
//    }
    @Test
    public void test11(){
        CourseDao courseDao=new Courseimply();
        List<Course> courses = courseDao.selectStudentCourseTable(1);
        courses.forEach(System.out::println);
    }
    @Test
    public void test12(){
        courseDao.add(new StudentCourse(3,3));
    }
}
